<template>
  <h1>{{num}}</h1>

  <input type="text" v-model="num">
  <h3>{{data.name}}</h3>
  <h3>{{data.user.uname}}</h3>
</template>

<!--
setup语法糖：目的简化开发
-->
<script setup>
import {reactive, ref, toRefs} from "vue";

    let num = ref(10); // 定义属性，相当于之前的data(){}

    let data = ref({
      name: "大锤",
      user: {
        id: 10086,
        uname: "小锤"
      }
    });

    let json = reactive({
      name: "张三",
      user: {
        id: 10087,
        uname: "小锤89"
      }
    })
</script>

<style scoped>

</style>